/**
 ******************************************************************************
 * @file    bsp_uart_diver.h
 * @author  ��Ӿ��
 * @date    2025/6/16
 * @version v1.0
 * @brief   UART��������ͷ�ļ����ṩ������ؽӿ�����
 ******************************************************************************
 */
#ifndef __BSP_UART_DIVER_H
#define __BSP_UART_DIVER_H
/********************** Include ************************/
#include "stdio.h"
#include "string.h"
#include "stdarg.h"

#include "mid_circular_buffer.h"
#include "communication_interface.h"

#include "usart.h"
/********************** Include ************************/

/********************** Define *************************/
#define UART_MAX 7
/********************** Define *************************/

/********************** Typedef ************************/


typedef enum
{//����״̬��Ϣ��־
	UART_NOERROR=0,//�ɹ�
	UART_USED,		//�ѱ�ʹ��
	UART_NOUARTLINK,//�޵ײ�ӿ�
	UART_NOUART,//�޶�Ӧ����
	UART_OTHER,//δ֪����
}UART_ERROR;
typedef enum
{
  BUF_A = 0,
  BUF_B = 1,
} UART_BUF_e;
/********************** Typedef ************************/

/********************** Statement **********************/
void UART_Task(void *pvParameters);
UART_ERROR uart_init(uint8_t uartx, void *cb);
char uart_send_byte(uint8_t uartx, uint8_t data);
char uart_send_str(uint8_t uartx, const char* str);
char uart_send_data(uint8_t uartx, uint8_t* data, uint16_t len);
void ore_error(uint8_t uartx);
int my_printf(UART_HandleTypeDef *huart, const char *format, ...);
/********************** Statement **********************/

#endif /* __BSP_UART_DIVER_H */

